package com.slofzx.nuoda.evaluation.project.enums;

import com.slofzx.nuoda.common.EnumConfig;
import com.slofzx.nuoda.common.config.Type;

/**
 * 井型枚举
 * @author sunfuyong
 */
@EnumConfig(id="well-course",name="井型")
public enum WellCourseEnum implements Type {
    VERTICAL("vertical_well","直井",1),
    DIRECTIONAL("directional_well","定向井",1.5),
    HORIZONTAL("horizontal_well","水平井",2),
    SIDETRACK_WELL_DIRECTIONAL("sidetrack_well","侧钻定向井",3),
    SIDETRACK_WELL_HORIZONTAL("sidetrack_well_horizontal","侧钻水平井",4),
    ;

    private String id;
    private String name;
    private double sort;

    WellCourseEnum(String id, String name, double sort) {
        this.id = id;
        this.name = name;
        this.sort = sort;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public double getSort() {
        return sort;
    }
    /**
     * 根据id获取对应的枚举
     * @param id 枚举值的标识
     * @return
     */
    public static WellCourseEnum getEnum(String id){
        for(WellCourseEnum dataTypeEnum: WellCourseEnum.values()){
            if(dataTypeEnum.getId().equals(id)){
                return dataTypeEnum;
            }
        }
        return null;
    }
}
